//
//  ZYNewFeatureController.m
//  sinaWeiBo_yu
//
//  Created by 振宇陈 on 16/9/5.
//  Copyright © 2016年 振宇陈. All rights reserved.
//

#import "ZYNewFeatureController.h"
#define kCount 4

@interface ZYNewFeatureController ()

@end

@implementation ZYNewFeatureController

-(void) loadView
{
    UIImageView * imageView =[[UIImageView alloc]init];
    imageView.image = [UIImage imageNamed:@"new_feature_background"];
    imageView.frame = [UIScreen mainScreen].bounds ;
    self.view =imageView;
}
/**
 *  控件无法显示：
 1、没有设置宽高
 2、位置不对
 3、Hidden属性为YES
 */
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    UIScrollView* scrollView = [[UIScrollView alloc]initWithFrame:self.view.bounds];
    scrollView.showsHorizontalScrollIndicator = NO;
    [self.view addSubview:scrollView ];
    CGFloat width = self.view.bounds.size.width;
    CGFloat height = self.view.bounds.size.height;
    for (int i =0; i<kCount; i++) {
        UIImageView* imageView = [[UIImageView alloc] init];
        NSString* name = [NSString stringWithFormat:@"new_feature_%d",i+1];
        imageView.image = [UIImage imageNamed:name];
        imageView.frame = CGRectMake(i*width, 0, width, height);
        [scrollView  addSubview:imageView];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
